package com.yituo.mjworld.mvc.entity.web;

import javax.persistence.*;
import java.util.Date;

@Entity
@Table(name = "wx_cache", schema = "web_mojianworld_server", catalog = "")
public class WxCache {
  private String openId;
  private String token;
  private Date tokenCreateTime;
  private String ticket;
  private Date ticketCreateTime;

  @Id
  @Column(name = "openId", nullable = false, length = 50)
  public String getOpenId() {
    return openId;
  }

  public void setOpenId(String openId) {
    this.openId = openId;
  }

  @Basic
  @Column(name = "token", nullable = true, length = 300)
  public String getToken() {
    return token;
  }

  public void setToken(String token) {
    this.token = token;
  }

  @Basic
  @Column(name = "tokenCreateTime", nullable = true)
  public Date getTokenCreateTime() {
    return tokenCreateTime;
  }

  public void setTokenCreateTime(Date tokenCreateTime) {
    this.tokenCreateTime = tokenCreateTime;
  }

  @Basic
  @Column(name = "ticket", nullable = true, length = 300)
  public String getTicket() {
    return ticket;
  }

  public void setTicket(String ticket) {
    this.ticket = ticket;
  }

  @Basic
  @Column(name = "ticketCreateTime", nullable = true)
  public Date getTicketCreateTime() {
    return ticketCreateTime;
  }

  public void setTicketCreateTime(Date ticketCreateTime) {
    this.ticketCreateTime = ticketCreateTime;
  }


  @Override
  public int hashCode() {
    int result = openId != null ? openId.hashCode() : 0;
    result = 31 * result + (token != null ? token.hashCode() : 0);
    result = 31 * result + (tokenCreateTime != null ? tokenCreateTime.hashCode() : 0);
    result = 31 * result + (ticket != null ? ticket.hashCode() : 0);
    result = 31 * result + (ticketCreateTime != null ? ticketCreateTime.hashCode() : 0);
    return result;
  }
}
